package com.dragon.modules.yuegou.query.member;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.member.BenefitEntity;
import com.dragon.modules.yuegou.enums.member.BenefitBenefitType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 商圈权益表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2021-12-15 17:04:53
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class BenefitQuery extends BenefitEntity implements Query<BenefitEntity> {


    /** id查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** [枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件 */
	@JsonUnwrapped(prefix = "benefitType")
	private Condition<BenefitBenefitType> benefitTypeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public BenefitQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public BenefitQuery(BenefitEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public BenefitQuery(BenefitQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.benefitTypeCondition != null) {
			this.benefitTypeCondition = other.benefitTypeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<BenefitEntity> toQueryWrapper() {
		QueryWrapper<BenefitEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (benefitTypeCondition != null) {
			benefitTypeCondition.toWrapper(wrapper, COL_BENEFIT_TYPE);
		}
		return wrapper;
	}

	/**
	 * 构造并返回id查询条件
	 * 
	 * @return idCondition id查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取id查询条件
	 * 
	 * @return idCondition id查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置id查询条件
	 * 
	 * @param idCondition id查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回[枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件
	 * 
	 * @return benefitTypeCondition [枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件
	 */
	public Condition<BenefitBenefitType> benefitType() {
		this.benefitTypeCondition = new Condition<>();
		return this.benefitTypeCondition;
	}
	
	/**
	 * 获取[枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件
	 * 
	 * @return benefitTypeCondition [枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件
	 */
	public Condition<BenefitBenefitType> getBenefitTypeCondition() {
		return benefitTypeCondition;
	}

	/**
	 * 设置[枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件
	 * 
	 * @param benefitTypeCondition [枚举]权益类型：0-商品折扣-DISCOUNT、1-多倍积分-MAGNIFICATION查询条件
	 */
	public void setBenefitTypeCondition(Condition<BenefitBenefitType> benefitTypeCondition) {
		this.benefitTypeCondition = benefitTypeCondition;
	}

}
